package com.example.redistempalte.controller;

import com.example.redistempalte.Publisher.MsgPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RedisTestController {

    @Autowired
    private MsgPublisher msgPublisher;

    @RequestMapping("/sendMsg")
    @ResponseBody
    public String sendMsg(@RequestParam("msg") String msg){
        msgPublisher.sendMsg(msg);
        return "发送成功！";
    }
}